{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="/Public/Css/front/front_css/my_wallet.css">
<style type="text/css">
	body{
		background-color: #f3f3f3;
	}
</style>
{/block}
{block name="content"}

<div class="title">
	
	<div class="go_back"></div>
	<p><strong>提现</strong></p>
</div>

<div class="subtitle">
	提现账户
</div>

 <div class="set_account">
	<div class="account_icon"></div>
	<h1>支付宝账户</h1>
	<h2>请先设置支付宝账户	</h2>
	<i class="icon_forward" style="position:absolute;top:1.8rem;right:3.2%;"></i>

</div>

<div class="withdraw_num">
	<div class="money">
		<h1>提现金额</h1>
		<h2>￥</h2><input type="number" class="input_money" id="input_money">
	</div>

		<span class="p1">可用余额</span>
		<span class="p2">￥</span><span class="p3" >1230</span>
		<span class="all_in">全部提现</span>

</div> 

<input type="submit" class="submit_gery" value="确认提现">

{/block}
{block name="js"}
{literal}
<script type="text/javascript">

	$('.return_icon').on('click',function(){
		window.location.href ='/Index/my_wallet'
	});

	$('.set_account').on('click',function(){
		window.location.href ='/Index/set_withdraw_account'
	});
	$('.withdraw_num').on('click','.all_in',function(){
		var allmoney = $('.p3').text();
		console.log(allmoney);
		var input_money = document.getElementById("input_money");
		input_money.value=allmoney;
		$('.submit_gery').addClass('orange');
	});

	$('.input_money').bind('input propertychange',function(){
	
		$('.submit_gery').addClass('orange');
		var number = $('.input_money').val();
		var num =parseInt(number);
		var money = $('.p3').text();
		var mon = parseInt(money);
		var length = number.length;
		console.log(number.length);
		console.log(num);
		console.log(mon);
		if(length ==0){
			$('.submit_gery').removeClass('orange');
		}
		if(num>mon){
			var input_money = document.getElementById("input_money");
			input_money.value=mon;
		}
	});
</script>
{/literal}
{/block}
